﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PadnugRepositoryInterfaces;
using PadnugRepository;
using padnug.Domain;

namespace PadnugService
{
    public class PadnugRoleService : IPadnugRoleService
    {
        private IPadnugRoleRepository _roleRepository;

        public PadnugRoleService(IPadnugRoleRepository roleRepository)
        {
            _roleRepository = roleRepository;    
        }

        #region IPadnugRoleService Members

        public bool IsUserInRole(string username, string roleName)
        {
            return _roleRepository.IsUserInRole(username, roleName);
        }

        public string[] GetRolesForUser(string username)
        {
            return _roleRepository.GetRolesForUser(username);
        }

        public bool RoleExists(string roleName)
        {
            return _roleRepository.RoleExists(roleName);
        }

        #endregion
    }
    public interface IPadnugRoleService
    {
        bool IsUserInRole(string username, string roleName);
        string[] GetRolesForUser(string username);
        bool RoleExists(string roleName);
    }
}
